<?php

namespace CloudTowerDev\F2FPay;

use YunTaIDC\Plugin\PluginPage;

use YunTaIDC\Order\Order;

class Page extends PluginPage{

    public function onLoad(){
        $gets = $this->getSystem()->getGetParams();
        if(empty($gets['orderid'])){
            exit('云塔IDC系统 - 当面付插件页面');
        }else{
            @header("Content-type: text/json");
            $order = new Order($gets['orderid'], $this);
            if($order->isExisted() === false){
                exit('{"code":-1,"msg":"不存在"}');
            }else{
                if($order->getStatus() == '已完成'){
                    exit('{"code":1,"msg":"付款成功","backurl":"./index.php?p=ClientArea&a=Orders"}');
                }else{
                    exit('{"code":-1,"msg":"未付款"}');
                }
            }
        }
    }

}

?>